import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    //重定向 
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    // meta 路由元信息 自定义的属性 可以供路由切换的时候所进行调用
    meta: { 
      isShow:true
     }
  },
  
  {
    path: '/topic',
    name: 'topic',
    component: () => import('../views/topic/index.vue'),
    meta: { 
      isShow:true
     }
  },
  {
    path: '/topic/:ida',
    name: 'details',
    component: () => import('../views/topic/details/index.vue'),
    meta: { 
      isShow:false
     }
  },
  {
    path: '/category',
    name: 'category',
    component: () => import('../views/category/index.vue'),
    meta: { 
      isShow:true
     }
  },
  {
    path: '/category/:id',
    name: 'categorylist',
    component: () => import('../views/category/list/index.vue'),
    meta: { 
      isShow:false
     }
  },
  {
    path: '/cart',
    name: 'cart',
    component: () => import('../views/cart/index.vue'),
    meta: { 
      isShow:true
     }
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/my/index.vue'),
    meta: { 
      isShow:true
     }
  },
  {
    path: '/home/city',
    name: 'city',
    component: () => import('../views/home/city/index.vue'),
    meta: { 
      isShow:false
     }
  },
  {
    path: '/home/touchsearch',
    name: 'touchsearch',
    component: () => import('../views/home/touchsearch/index.vue'),
    meta: { 
      isShow:false
     }
  },

  {
    path: '/home/brand',
    name: 'brand',
    component: () => import('../views/home/brand/index.vue'),
    meta: { 
      isShow:false
     }
  },
  {
    path: '/home/brand/:ids',
    name: 'detailaction',
    component: () => import('../views/home/brand/detailaction/index.vue'),
    meta: { 
      isShow:false
     }
  },
  {
    path: '/home/:idb',
    name: 'homeList',
    component: () => import('../views/home/homeList/index.vue'),
    meta: { 
      isShow:false
     }
  },
]

const router = new VueRouter({
  routes
})

export default router
